import java.util.Scanner;

public class two {
    public static void main(String[] args) {
        System.out.println("请输入数字");
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        for(int i=100;i<=a;i++){
            int g=i%10;
            int s=i/10%10;
            int b=i/100;
            if(g*g*g+s*s*s+b*b*b==i){
                System.out.println((i));
            }
        }
    }
}
